import {MatDialog, MatDialogRef} from '@angular/material';
import {AlertDialogComponent} from '../component/dialog/alert.dialog.component';
import {LoadingDialogComponent} from '../component/dialog/loading.dialog.component';

export function alertDialog(dialog: MatDialog, t: string, msg: string, w = 250, showNo = false): MatDialogRef<AlertDialogComponent> {
  return dialog.open(AlertDialogComponent, {
    width: w + 'px',
    data: {
      title: t,
      message: msg,
      showNoButton: showNo,
    }
  });
}

export function loadingDialog(dialog: MatDialog): MatDialogRef<LoadingDialogComponent> {
  return dialog.open(LoadingDialogComponent, {
    width: '250px',
    height: '250px'
  });
}
